template(name="cardDetails")
  section.card-details.js-card-details(class='{{#if cardMaximized}}card-details-maximized{{/if}}'): .card-details-canvas
    .card-details-header(class='{{#if colorClass}}card-details-{{colorClass}}{{/if}}')
      +inlinedForm(classNames="js-card-details-title")
        +editCardTitleForm
      else
        unless isMiniScreen
          a.fa.fa-times-thin.close-card-details.js-close-card-details(title="{{_ 'close-card'}}")
          unless cardMaximized
            a.fa.fa-expand.card-details-menu.js-maximize-card-details(title="{{_ 'maximize-card'}}")
          if cardMaximized
            a.fa.fa-compress.card-details-menu.js-minimize-card-details(title="{{_ 'minimize-card'}}")
          if currentUser.isBoardMember
            if canModifyCard
              unless currentUser.isWorker
                a.fa.fa-trash.card-details-menu.js-archives(title="{{_ 'archive-card'}}")
            a.fa.fa-navicon.card-details-menu.js-open-card-details-menu(title="{{_ 'cardDetailsActionsPopup-title'}}")
            input.inline-input(type="text" id="cardURL_copy" value="{{ originRelativeUrl }}")
            a.fa.fa-link.card-copy-button.js-copy-link(
              class="fa-link"
              title="{{_ 'copy-card-link-to-clipboard'}}"
            )
        if isMiniScreen
          a.fa.fa-times-thin.close-card-details-mobile-web.js-close-card-details(title="{{_ 'close-card'}}")
          unless cardMaximized
            a.fa.fa-expand.card-details-menu.js-maximize-card-details(title="{{_ 'maximize-card'}}")
          if cardMaximized
            a.fa.fa-compress.card-details-menu.js-minimize-card-details(title="{{_ 'minimize-card'}}")
          if currentUser.isBoardMember
            a.fa.fa-navicon.card-details-menu-mobile-web.js-open-card-details-menu(title="{{_ 'cardDetailsActionsPopup-title'}}")
            a.fa.fa-link.card-copy-mobile-button
            if canModifyCard
              unless currentUser.isWorker
                a.fa.fa-trash.card-details-menu.js-archives(title="{{_ 'archive-card'}}")
        h2.card-details-title.js-card-title(
          class="{{#if canModifyCard}}js-open-inlined-form is-editable{{/if}}")
            +viewer
              = getTitle
              if isWatching
                i.card-details-watch.iconkb.iconkb-subscribe
        .card-details-path
          each parentList
            | &nbsp; &gt; &nbsp;
            a.js-parent-card(href=linkForCard) {{title}}
          // else
            {{_ 'top-level-card'}}
        if isLinkedCard
          a.linked-card-location.js-go-to-linked-card
            +viewer
              | {{getBoardTitle}} > {{getTitle}}

    if getArchived
      if isLinkedBoard
        p.warning {{_ 'board-archived'}}
      else
        p.warning {{_ 'card-archived'}}
    .card-content-box
      span.iconkb.iconkb-dobble-arrow-up.toggle-toolbar.js-toggle-toolbar
      .card-content-box-toolbar
        span.tool-title 添加至卡片
        button.toolbar-btn.js-add-members
          i.iconkb.iconkb-addmember.toolbar-btn-icon
          成员
        button.toolbar-btn.js-add-labels
          i.iconkb.iconkb-label.toolbar-btn-icon
          标签
        button.toolbar-btn.toolbar-btn-icon.js-spent-time
          i.iconkb.iconkb-clock.toolbar-btn-icon
          工时
        if currentUser.isAdmin
          if currentBoard.allowsAttachments
            button.toolbar-btn.js-add-attachment-c
              i.iconkb.iconkb-attachment.toolbar-btn-icon
              附件
        button.toolbar-btn.js-start-date
          i.iconkc.iconkc-start-time.toolbar-btn-icon
          开始时间
        button.toolbar-btn.js-due-date
          i.iconkc.iconkc-end-time.toolbar-btn-icon
          截止时间
        button.toolbar-btn.js-start-voting
          i.iconkb.iconkb-thumbs-up.toolbar-btn-icon
          编辑投票
        button.toolbar-btn.js-start-planning-poker
          i.iconkb.iconkb-poker.toolbar-btn-icon
          | {{_ 'card-edit-planning-poker'}}
        span.tool-title 操作
        button.toolbar-btn.js-copy-card
          i.iconkb.iconkb-copy.toolbar-btn-icon
          复制
        button.toolbar-btn.js-export-card
          i.iconkb.iconkb-share-alt.toolbar-btn-icon
          导出卡片
        button.toolbar-btn.js-move-card-to-top
          i.iconkb.iconkb-move.toolbar-btn-icon(style="transform: rotate(-90deg)")
          移动至顶端
         button.toolbar-btn.js-move-card-to-bottom
          i.iconkb.iconkb-move.toolbar-btn-icon(style="transform: rotate(90deg)")
          移动至底端
        button.toolbar-btn.js-move-card
          i.iconkb.iconkb-move.toolbar-btn-icon
          移动
        button.toolbar-btn.js-toggle-watch-card
          i.iconkb.iconkb-subscribe.toolbar-btn-icon
          关注
          if isWatching
            span.c-watch.iconkb.iconkb-check

        button.toolbar-btn.js-archive
          i.iconkb.iconkb-archive.toolbar-btn-icon
          归档

      .card-content-box-main
        .card-details-left
          //.card-details-items
          h3.card-details-item-title
                  i.iconkb.iconkb-card.c-title-icon
                  基础项
          .card-details-items

            if currentBoard.allowsMembers
              .card-details-item.card-details-item-members(style="padding: 0 0 10px 0;")
                h3.card-details-item-title-1
                  | {{_ 'members'}}
                each userId in getMembers
                  .user-box(style="margin:0 4px 0 0;float:left")
                    +userAvatar(userId=userId cardId=_id)
                      div(style="width=10px")
                    | {{! XXX Hack to hide syntaxic coloration /// }}
                if canModifyCard
                  unless currentUser.isWorker
                    a.member.add-member.card-details-item-add-button.js-add-members(title="{{_ 'card-members-title'}}")
                      i.iconkb.iconkb-plus

            //if assigneeSelected
            if currentBoard.allowsAssignee
              .card-details-item.card-details-item-assignees(style="padding: 0 0 10px 0;")
                h3.card-details-item-title-1
                  i.fa.fa-user
                  | {{_ 'assignee'}}
                each userId in getAssignees
                  .user-box(style="margin:0 4px 0 0;float:left")
                    +userAvatar(userId=userId cardId=_id assignee=true)
                    | {{! XXX Hack to hide syntaxic coloration /// }}
                if canModifyCard
                  a.assignee.add-assignee.card-details-item-add-button.js-add-assignees(title="{{_ 'assignee'}}")
                    i.iconkb.iconkb-plus
                if currentUser.isWorker
                  unless assigneeSelected
                    a.assignee.add-assignee.card-details-item-add-button.js-add-assignees(title="{{_ 'assignee'}}")
                      i.iconkb.iconkb-plus

            if currentBoard.allowsCreator
              .card-details-item.card-details-item-creator(style="padding: 0 0 10px 0;")
                h3.card-details-item-title-1
                  | {{_ 'creator'}}

                +userAvatar(userId=userId noRemove=true)
                | {{! XXX Hack to hide syntaxic coloration /// }}
            if currentBoard.allowsLabels
              hr(style="background:none;margin:0")
              .card-details-item.card-details-item-labels(style="padding: 0 0 10px 0;")
                h3.card-details-item-title-1
                  //-   i.fa.fa-tags
                  | {{_ 'labels'}}
                a(class="{{#if canModifyCard}}js-add-labels{{else}}is-disabled{{/if}}" title="{{_ 'card-labels-title'}}")
                  each labels
                    span.card-label(class="card-label-{{color}}" title=name)
                      +viewer
                        = name
                if canModifyCard
                  unless currentUser.isWorker
                    a.card-label.add-label.js-add-labels(title="{{_ 'card-labels-title'}}" style="color:#42526e")
                      i.iconkb.iconkb-plus

            if currentBoard.allowsReceivedDate
              hr
              .card-details-item.card-details-item-received(style="padding: 0 0 10px 0;")
                h3.card-details-item-title-1
                  i.fa.fa-sign-out
                  | {{_ 'card-received'}}
                if getReceived
                  +cardReceivedDate
                else
                  if canModifyCard
                    unless currentUser.isWorker
                      a.card-label.add-label.js-received-date
                        i.iconkb.iconkb-plus

            if currentBoard.allowsStartDate
              hr(style="background:none;margin:0")
              .card-details-item.card-details-item-start(style="padding: 0 0 10px 0;")
                h3.card-details-item-title-1
                  //-   i.fa.fa-hourglass-start
                  | {{_ 'card-start'}}
                if getStart
                  +cardStartDate
                else
                  if canModifyCard
                    unless currentUser.isWorker
                      a.card-label.add-label.js-start-date(style="color: #42526e;")
                        i.iconkb.iconkb-plus

            if currentBoard.allowsDueDate
              .card-details-item.card-details-item-due(style="padding: 0 0 10px 0;")
                h3.card-details-item-title-1
                  //-   i.fa.fa-sign-in
                  | {{_ 'card-due'}}
                if getDue
                  +cardDueDate
                else
                  if canModifyCard
                    unless currentUser.isWorker
                      a.card-label.add-label.js-due-date(style="color: #42526e;")
                        i.iconkb.iconkb-plus

            if currentBoard.allowsEndDate
              .card-details-item.card-details-item-end(style="padding: 0 0 10px 0;")
                h3.card-details-item-title-1
                  i.fa.fa-hourglass-end
                  | {{_ 'card-end'}}
                if getEnd
                  +cardEndDate
                else
                  if canModifyCard
                    unless currentUser.isWorker
                      a.card-label.add-label.js-end-date
                        i.iconkb.iconkb-plus

            //- hr
            //.card-details-items
            if getSpentTime
              .card-details-item.card-details-item-spent(style="padding: 0 0 10px 0;")
                if getIsOvertime
                  h3.card-details-item-title-1
                    | {{_ 'overtime-hours'}}
                else
                  h3.card-details-item-title-1
                    | {{_ 'spent-time-hours'}}
                +cardSpentTime

            //.card-details-items
            if currentBoard.allowsRequestedBy
              .card-details-item.card-details-item-name(style="padding: 0 0 10px 0;")
                h3.card-details-item-title-1
                  i.fa.fa-shopping-cart
                  | {{_ 'requested-by'}}
                if canModifyCard
                  unless currentUser.isWorker
                    +inlinedForm(classNames="js-card-details-requester")
                      +editCardRequesterForm
                    else
                      a.js-open-inlined-form
                        if getRequestedBy
                          +viewer
                            = getRequestedBy
                        else
                          | {{_ 'add'}}
                else if getRequestedBy
                  +viewer
                    = getRequestedBy

            if currentBoard.allowsAssignedBy
              .card-details-item.card-details-item-name(style="padding: 0 0 10px 0;")
                h3.card-details-item-title-1
                  i.fa.fa-user-plus
                  | {{_ 'assigned-by'}}
                if canModifyCard
                  unless currentUser.isWorker
                    +inlinedForm(classNames="js-card-details-assigner")
                      +editCardAssignerForm
                    else
                      a.js-open-inlined-form
                        if getAssignedBy
                          +viewer
                            = getAssignedBy
                        else
                          | {{_ 'add'}}
                else if getRequestedBy
                  +viewer
                    = getAssignedBy

            if currentBoard.allowsCardSortingByNumber
              .card-details-item.card-details-sort-order
                h3.card-details-item-title-1
                  i.fa.fa-sort
                  | {{_ 'sort'}}
                if canModifyCard
                  +inlinedForm(classNames="js-card-details-sort")
                    +editCardSortOrderForm
                  else
                    a.js-open-inlined-form
                      +viewer
                        = sort

            //.card-details-items
            if customFieldsWD
              //- hr
              each customFieldsWD
                .card-details-item.card-details-item-customfield
                  h3.card-details-item-title-1
                    i.fa.fa-list-alt
                    = definition.name
                  +cardCustomField
          //- XXX We should use "editable" to avoid repetiting ourselves
          if canModifyCard
            unless currentUser.isWorker
              if currentBoard.allowsDescriptionTitle
                hr
                h3.card-details-item-title
                  i.iconkb.iconkb-description.c-title-icon
                  | {{_ 'description'}}
              if currentBoard.allowsDescriptionText
                .des-box(style="padding:0 0 10px 35px;box-sizing:border-box")
                  +inlinedCardDescription(classNames="card-description js-card-description")
                    +descriptionForm
                    .edit-controls.clearfix
                      button.primary(type="submit") {{_ 'save'}}
                      a.fa.fa-times-thin.js-close-inlined-form
                  else
                    if currentBoard.allowsDescriptionText
                      a.js-open-inlined-form
                        if getDescription
                          +viewer(classNames="viewer-c")
                            = getDescription
                        else
                          +viewer(classNames="viewer-c")
                            = '添加详细描述...'
                      if (hasUnsavedValue 'cardDescription' _id)
                        p.quiet
                          | {{_ 'unsaved-description'}}
                          a.js-open-inlined-form {{_ 'view-it'}}
                          = ' - '
                          a.js-close-inlined-form {{_ 'discard'}}
          else if getDescription
            if currentBoard.allowsDescriptionTitle
              hr
              h3.card-details-item-title {{_ 'description'}}
            if currentBoard.allowsDescriptionText
              +viewer
                = getDescription

          .card-checklist-attachmentGalerys
            .card-checklist-attachmentGalery.card-checklists
              if currentBoard.allowsChecklists
                hr
                +checklists(cardId = _id classNames1="c-title-icon")
              if currentBoard.allowsSubtasks
                hr
                +subtasks(cardId = _id)
            if currentUser.isAdmin
              if currentBoard.allowsAttachments
                hr
                h3.card-details-item-title
                  i.iconkb.iconkb-attachment.c-title-icon
                  | {{_ 'attachments'}}
                .card-checklist-attachmentGalery.card-attachmentGalery
                  +attachmentsGalery

          if getVoteQuestion
            hr
            .vote-title
              div.flex
                h3
                  i.iconkb.iconkb-thumbs-up.c-title-icon
                  | {{_ 'vote-question'}}
                if getVoteEnd
                  +voteEndDate
              .vote-result
                if votePublic
                  a.card-label.card-label-green.js-show-positive-votes {{ voteCountPositive }}
                  a.card-label.card-label-red.js-show-negative-votes {{ voteCountNegative }}
                else
                  .card-label.card-label-green {{ voteCountPositive }}
                  .card-label.card-label-red {{ voteCountNegative }}
                unless ($and currentBoard.isPublic voteAllowNonBoardMembers )
                  .card-label.card-label-gray  {{ voteCount }} {{_ 'r-of' }} {{ currentBoard.activeMembers.length }}
            .vote-box
              +viewer(classNames="viewer-c1")
                = getVoteQuestion
              if showVotingButtons
                button.card-details-green.js-vote.js-vote-positive(class="{{#if voteState}}voted{{/if}}")
                  if voteState
                    i.iconkb.iconkb-thumbs-up
                  | {{_ 'vote-for-it'}}
                button.card-details-red.js-vote.js-vote-negative(class="{{#if $eq voteState false}}voted{{/if}}")
                  if $eq voteState false
                    i.iconkb.iconkb-thumbs-up(style="display:inline-block;transform: rotateX(180deg);vertical-align: middle")
                  | {{_ 'vote-against'}}

          if getPokerQuestion
            hr
            .poker-title
              div.flex
                h3
                  i.iconkb.iconkb-poker.c-title-icon
                  | {{_ 'poker-question'}}
                if getPokerEnd
                  +pokerEndDate
              div.flex
                .poker-result
                  if expiredPoker
                    unless ($and currentBoard.isPublic pokerAllowNonBoardMembers )
                      .card-label.card-label-gray  {{ pokerCount }} {{_ 'r-of' }} {{ currentBoard.activeMembers.length }}
            .poker-box
              if showPlanningPokerButtons
                .poker-result
                  .poker-deck
                    .poker-card
                      span.inner.js-poker.js-poker-vote-one(class="{{#if $eq pokerState 'one'}}poker-voted{{/if}}") {{_ 'poker-one'}}
                    if $eq pokerState "one"
                      i.fa.fa-check
                  .poker-deck
                    .poker-card
                      span.inner.js-poker.js-poker-vote-two(class="{{#if $eq pokerState 'two'}}poker-voted{{/if}}") {{_ 'poker-two'}}
                    if $eq pokerState "two"
                      i.fa.fa-check
                  .poker-deck
                    .poker-card
                      span.inner.js-poker.js-poker-vote-three(class="{{#if $eq pokerState 'three'}}poker-voted{{/if}}") {{_ 'poker-three'}}
                    if $eq pokerState "three"
                      i.fa.fa-check
                  .poker-deck
                    .poker-card
                      span.inner.js-poker.js-poker-vote-five(class="{{#if $eq pokerState 'five'}}poker-voted{{/if}}") {{_ 'poker-five'}}
                    if $eq pokerState "five"
                      i.fa.fa-check
                  .poker-deck
                    .poker-card
                      span.inner.js-poker.js-poker-vote-eight(class="{{#if $eq pokerState 'eight'}}poker-voted{{/if}}") {{_ 'poker-eight'}}
                    if $eq pokerState "eight"
                      i.fa.fa-check
                  .poker-deck
                    .poker-card
                      span.inner.js-poker.js-poker-vote-thirteen(class="{{#if $eq pokerState 'thirteen'}}poker-voted{{/if}}") {{_ 'poker-thirteen'}}
                    if $eq pokerState "thirteen"
                      i.fa.fa-check
                  .poker-deck
                    .poker-card
                      span.inner.js-poker.js-poker-vote-twenty(class="{{#if $eq pokerState 'twenty'}}poker-voted{{/if}}") {{_ 'poker-twenty'}}
                    if $eq pokerState "twenty"
                      i.fa.fa-check
                  .poker-deck
                    .poker-card
                      span.inner.js-poker.js-poker-vote-forty(class="{{#if $eq pokerState 'forty'}}poker-voted{{/if}}") {{_ 'poker-forty'}}
                    if $eq pokerState "forty"
                      i.fa.fa-check
                  .poker-deck
                    .poker-card
                      span.inner.js-poker.js-poker-vote-one-hundred(class="{{#if $eq pokerState 'oneHundred'}}poker-voted{{/if}}") {{_ 'poker-oneHundred'}}
                    if $eq pokerState "oneHundred"
                      i.fa.fa-check
                  .poker-deck
                    .poker-card
                      span.inner.js-poker.js-poker-vote-unsure(class="{{#if $eq pokerState 'unsure'}}poker-voted{{/if}}") {{_ 'poker-unsure'}}
                    if $eq pokerState "unsure"
                      i.fa.fa-check

                if currentUser.isBoardAdmin
                  button.card-details-blue.js-poker-finish(class="{{#if $eq voteState false}}poker-voted{{/if}}") {{_ 'poker-finish'}}
            .poker-box
              if expiredPoker
                .poker-table
                  .poker-table-side-left
                    .poker-table-heading-left
                      .poker-table-row
                        .poker-table-cell
                        .poker-table-cell
                          | {{_ 'poker-result-votes' }}
                        .poker-table-cell.poker-table-cell-who
                          | {{_ 'poker-result-who' }}
                    .poker-table-body
                      .poker-table-row
                        .poker-table-cell
                          button.card-details-gray.js-poker.poker-card-result(class="{{#if $eq pokerWinner 1}}winner{{else}}loser{{/if}}") {{_ 'poker-one'}}
                        .poker-table-cell {{ pokerCountOne }}
                        .poker-table-cell.poker-table-cell-who
                          .poker-result
                              each m in pokerMemberOne
                                a.name
                                  +userAvatar(userId=m._id noRemove=true)

                      .poker-table-row
                        .poker-table-cell
                          button.card-details-gray.js-poker.poker-card-result(class="{{#if $eq pokerWinner 2}}winner{{else}}loser{{/if}}") {{_ 'poker-two'}}
                        .poker-table-cell {{ pokerCountTwo }}
                        .poker-table-cell.poker-table-cell-who
                          .poker-result
                              each m in pokerMemberTwo
                                a.name
                                  +userAvatar(userId=m._id noRemove=true)

                      .poker-table-row
                        .poker-table-cell
                          button.card-details-gray.js-poker.poker-card-result(class="{{#if $eq pokerWinner 3}}winner{{else}}loser{{/if}}") {{_ 'poker-three'}}
                        .poker-table-cell {{ pokerCountThree }}
                        .poker-table-cell.poker-table-cell-who
                          .poker-result
                              each m in pokerMemberThree
                                a.name
                                  +userAvatar(userId=m._id noRemove=true)

                      .poker-table-row
                        .poker-table-cell
                          button.card-details-gray.js-poker.poker-card-result(class="{{#if $eq pokerWinner 5}}winner{{else}}loser{{/if}}") {{_ 'poker-five'}}
                        .poker-table-cell {{ pokerCountFive }}
                        .poker-table-cell.poker-table-cell-who
                          .poker-result
                              each m in pokerMemberFive
                                a.name
                                  +userAvatar(userId=m._id noRemove=true)

                      .poker-table-row
                        .poker-table-cell
                          button.card-details-gray.js-poker.poker-card-result(class="{{#if $eq pokerWinner 8}}winner{{else}}loser{{/if}}") {{_ 'poker-eight'}}
                        .poker-table-cell {{ pokerCountEight }}
                        .poker-table-cell.poker-table-cell-who
                          .poker-result
                              each m in pokerMemberEight
                                a.name
                                  +userAvatar(userId=m._id noRemove=true)

                  .poker-table-side-right
                    .poker-table-heading-right
                      .poker-table-row
                        .poker-table-cell
                        .poker-table-cell
                          | {{_ 'poker-result-votes' }}
                        .poker-table-cell.poker-table-cell-who
                          | {{_ 'poker-result-who' }}
                    .poker-table-body
                      .poker-table-row
                        .poker-table-cell
                          button.card-details-gray.js-poker.poker-card-result(class="{{#if $eq pokerWinner 13}}winner{{else}}loser{{/if}}") {{_ 'poker-thirteen'}}
                        .poker-table-cell {{ pokerCountThirteen }}
                        .poker-table-cell.poker-table-cell-who
                          .poker-result
                              each m in pokerMemberThirteen
                                a.name
                                  +userAvatar(userId=m._id noRemove=true)

                      .poker-table-row
                        .poker-table-cell
                          button.card-details-gray.js-poker.poker-card-result(class="{{#if $eq pokerWinner 20}}winner{{else}}loser{{/if}}") {{_ 'poker-twenty'}}
                        .poker-table-cell {{ pokerCountTwenty }}
                        .poker-table-cell.poker-table-cell-who
                          .poker-result
                              each m in pokerMemberTwenty
                                a.name
                                  +userAvatar(userId=m._id noRemove=true)

                      .poker-table-row
                        .poker-table-cell
                          button.card-details-gray.js-poker.poker-card-result(class="{{#if $eq pokerWinner 40}}winner{{else}}loser{{/if}}") {{_ 'poker-forty'}}
                        .poker-table-cell {{ pokerCountForty }}
                        .poker-table-cell.poker-table-cell-who
                          .poker-result
                              each m in pokerMemberForty
                                a.name
                                  +userAvatar(userId=m._id noRemove=true)

                      .poker-table-row
                        .poker-table-cell
                          button.card-details-gray.js-poker.poker-card-result(class="{{#if $eq pokerWinner 100}}winner{{else}}loser{{/if}}") {{_ 'poker-oneHundred'}}
                        .poker-table-cell {{ pokerCountOneHundred }}
                        .poker-table-cell.poker-table-cell-who
                          .poker-result
                              each m in pokerMemberOneHundred
                                a.name
                                  +userAvatar(userId=m._id noRemove=true)

                      .poker-table-row
                        .poker-table-cell
                          button.card-details-gray.js-poker.poker-card-result(class="{{#if $eq pokerWinner 'unsure'}}winner{{else}}loser{{/if}}") {{_ 'poker-unsure'}}
                        .poker-table-cell {{ pokerCountUnsure }}
                        .poker-table-cell.poker-table-cell-who
                          .poker-result
                              each m in pokerMemberUnsure
                                a.name
                                  +userAvatar(userId=m._id noRemove=true)

                if currentUser.isBoardAdmin
                  div.estimation-add
                    button.card-details-red.js-poker-replay(class="{{#if $eq voteState false}}voted{{/if}}") {{_ 'poker-replay'}}
                  div.estimation-add
                    button.js-poker-estimation
                      i.iconkb.iconkb-plus
                      | {{_ 'set-estimation'}}
                    input(type=text,autofocus value=getPokerEstimation,id="pokerEstimation")

        .card-details-right

          unless currentUser.isNoComments
            .activity-title
              h3.card-details-item-title
                i.fa.fa-history
                | {{ _ 'activity'}}
              if currentUser.isBoardMember
                .material-toggle-switch(title="{{_ 'hide-system-messages'}}")
                  //span.toggle-switch-title
                  if hiddenSystemMessages
                    input.toggle-switch(type="checkbox" id="toggleButton" checked="checked")
                  else
                    input.toggle-switch(type="checkbox" id="toggleButton")
                  label.toggle-label(for="toggleButton")
          if currentBoard.allowsComments
            if currentUser.isBoardMember
              unless currentUser.isNoComments
                +commentForm
          unless currentUser.isNoComments
            if isLoaded.get
              if isLinkedCard
                +activities(card=this mode="linkedcard")
              else if isLinkedBoard
                +activities(card=this mode="linkedboard")
              else
                +activities(card=this mode="card")

template(name="editCardTitleForm")
  textarea.js-edit-card-title(rows='1' autofocus dir="auto")
    = getTitle
  .edit-controls.clearfix
    button.primary.confirm.js-submit-edit-card-title-form(type="submit") {{_ 'save'}}
    a.fa.fa-times-thin.js-close-inlined-form

template(name="editCardRequesterForm")
  input.js-edit-card-requester(type='text' autofocus value=getRequestedBy dir="auto")
  .edit-controls.clearfix
    button.primary.confirm.js-submit-edit-card-requester-form(type="submit") {{_ 'save'}}
    a.fa.fa-times-thin.js-close-inlined-form

template(name="editCardAssignerForm")
  input.js-edit-card-assigner(type='text' autofocus value=getAssignedBy dir="auto")
  .edit-controls.clearfix
    button.primary.confirm.js-submit-edit-card-assigner-form(type="submit") {{_ 'save'}}
    a.fa.fa-times-thin.js-close-inlined-form

template(name="editCardSortOrderForm")
  input.js-edit-card-sort(type='text' autofocus value=sort dir="auto")
  .edit-controls.clearfix
    button.primary.confirm.js-submit-edit-card-sort-form(type="submit") {{_ 'save'}}
    a.fa.fa-times-thin.js-close-inlined-form

template(name="cardDetailsActionsPopup")
  ul.pop-over-list
    li
      a.js-toggle-watch-card
        if isWatching
          i.fa.fa-eye
          |  {{_ 'unwatch'}}
        else
          i.fa.fa-eye-slash
          |  {{_ 'watch'}}
  hr
  if canModifyCard
    unless currentUser.isWorker
      ul.pop-over-list
        //li: a.js-members {{_ 'card-edit-members'}}
        //li: a.js-labels {{_ 'card-edit-labels'}}
        //li: a.js-attachments {{_ 'card-edit-attachments'}}
        li
          a.js-start-voting
            i.fa.fa-thumbs-up
            | {{_ 'card-edit-voting'}}
        li
          a.js-start-planning-poker
            i.fa.fa-thumbs-up
            | {{_ 'card-edit-planning-poker'}}
        if currentUser.isBoardAdmin
          li
            a.js-custom-fields
              i.fa.fa-list-alt
              | {{_ 'card-edit-custom-fields'}}
        //li: a.js-received-date {{_ 'editCardReceivedDatePopup-title'}}
        //li: a.js-start-date {{_ 'editCardStartDatePopup-title'}}
        //li: a.js-due-date {{_ 'editCardDueDatePopup-title'}}
        //li: a.js-end-date {{_ 'editCardEndDatePopup-title'}}
        li
          a.js-spent-time
            i.fa.fa-clock-o
            | {{_ 'editCardSpentTimePopup-title'}}
        li
          a.js-set-card-color
            i.fa.fa-paint-brush
            | {{_ 'setCardColorPopup-title'}}
  hr
  ul.pop-over-list
    li
      a.js-export-card
        i.fa.fa-share-alt
        | {{_ 'export-card'}}
  hr
  ul.pop-over-list
    li
      a.js-move-card-to-top
        i.fa.fa-arrow-up
        | {{_ 'moveCardToTop-title'}}
    li
      a.js-move-card-to-bottom
        i.fa.fa-arrow-down
        | {{_ 'moveCardToBottom-title'}}
  hr
  ul.pop-over-list
    if currentUser.isBoardAdmin
      li
        a.js-move-card
          i.fa.fa-arrow-right
          | {{_ 'moveCardPopup-title'}}
    unless currentUser.isWorker
      li
        a.js-copy-card
          i.fa.fa-copy
          | {{_ 'copyCardPopup-title'}}
  unless currentUser.isWorker
    hr
    ul.pop-over-list
      li
        a.js-copy-checklist-cards
          i.fa.fa-list
          i.fa.fa-copy
          | {{_ 'copyChecklistToManyCardsPopup-title'}}
    unless archived
      hr
      ul.pop-over-list
        li
          a.js-archive
            i.fa.fa-arrow-right
            i.fa.fa-archive
            | {{_ 'archive-card'}}
    hr
    ul.pop-over-list
      li
        a.js-more
          i.fa.fa-link
          | {{_ 'cardMorePopup-title'}}

template(name="exportCardPopup")
  ul.pop-over-list
    li
      a(href="{{exportUrlCardPDF}}",, download="{{exportFilenameCardPDF}}")
        i.fa.fa-share-alt
        | {{_ 'export-card-pdf'}}

template(name="moveCardPopup")
  +boardsAndLists

template(name="copyCardPopup")
  label(for='copy-card-title') {{_ 'title'}}:
  textarea#copy-card-title.minicard-composer-textarea.js-card-title(autofocus)
    = getTitle
  +boardsAndLists

template(name="copyChecklistToManyCardsPopup")
  label(for='copy-checklist-cards-title') {{_ 'copyChecklistToManyCardsPopup-instructions'}}:
  textarea#copy-card-title.minicard-composer-textarea.js-card-title(autofocus)
    | {{_ 'copyChecklistToManyCardsPopup-format'}}
  +boardsAndLists

template(name="boardsAndLists")
  unless currentUser.isWorker
    label {{_ 'boards'}}:
    select.js-select-boards(autofocus)
      each boards
        if $eq _id currentBoard._id
          option(value="{{_id}}" selected) {{_ 'current'}}
        else
          option(value="{{_id}}") {{title}}

  label {{_ 'swimlanes'}}:
  select.js-select-swimlanes
    each swimlanes
      option(value="{{_id}}") {{title}}

  label {{_ 'lists'}}:
  select.js-select-lists
    each aBoardLists
      option(value="{{_id}}") {{title}}

  .edit-controls.clearfix
    button.primary.confirm.js-done {{_ 'done'}}

template(name="cardMembersPopup")
  ul.pop-over-list.js-card-member-list
    each user in boardMembers
      li.item(class="{{#if user.isCardMember}}active{{/if}}")
        a.name.js-select-member(href="#")
          +userAvatar(userId=user._id)
          span.full-name
            = user.profile.fullname
            | (<span class="username">{{ user.username }}</span>)
          if user.isCardMember
            i.fa.fa-check

template(name="cardAssigneesPopup")
  unless currentUser.isWorker
    ul.pop-over-list.js-card-assignee-list
      each user in boardAssignees
        li.item(class="{{#if user.isCardAssignee}}active{{/if}}")
          a.name.js-select-assignee(href="#")
            +userAvatar(userId=user._id)
            span.full-name
              = user.profile.fullname
              | (<span class="username">{{ user.username }}</span>)
            if user.isCardAssignee
              i.fa.fa-check
  if currentUser.isWorker
    ul.pop-over-list.js-card-assignee-list
      li.item(class="{{#if currentUser.isCardAssignee}}active{{/if}}")
        a.name.js-select-assignee(href="#")
          +userAvatar(userId=currentUser._id)
          span.full-name
            = currentUser.profile.fullname
            | (<span class="username">{{ currentUser.username }}</span>)
          if currentUser.isCardAssignee
            i.fa.fa-check

template(name="cardAssigneePopup")
  .board-assignee-menu
    .mini-profile-info
      +userAvatar(userId=user._id showEdit=true)
      .info
        h3= user.profile.fullname
        p.quiet @{{ user.username }}
    ul.pop-over-list
      if currentUser.isNotCommentOnly
        unless currentUser.isWorker
          li: a.js-remove-assignee {{_ 'remove-member-from-card'}}

      unless currentUser.isWorker
        if $eq currentUser._id user._id
          with currentUser
            li: a.js-edit-profile {{_ 'edit-profile'}}

template(name="cardMorePopup")
  p.quiet
    span.clearfix
      span {{_ 'link-card'}}
      = ' '
      i.fa.colorful(class="{{#if board.isPublic}}fa-globe{{else}}fa-lock{{/if}}")
      input.inline-input(type="text" id="cardURL" readonly value="{{ originRelativeUrl }}" autofocus="autofocus")
      button.js-copy-card-link-to-clipboard(class="btn" id="clipboard") {{_ 'copy-card-link-to-clipboard'}}
    span.clearfix
    br
    h2 {{_ 'change-card-parent'}}
    label {{_ 'source-board'}}:
      select.js-field-parent-board
        if isTopLevel
          option(value="none" selected) {{_ 'custom-field-dropdown-none'}}
        else
          option(value="none") {{_ 'custom-field-dropdown-none'}}
        each boards
          if isParentBoard
            option(value="{{_id}}" selected) {{title}}
          else
            option(value="{{_id}}") {{title}}

    label {{_ 'parent-card'}}:
      select.js-field-parent-card
        if isTopLevel
          option(value="none" selected) {{_ 'custom-field-dropdown-none'}}
        else
          option(value="none") {{_ 'custom-field-dropdown-none'}}
          each cards
            if isParentCard
              option(value="{{_id}}" selected) {{title}}
            else
              option(value="{{_id}}") {{title}}
    br
    | {{_ 'added'}}
    span.date(title=card.createdAt) {{ moment createdAt 'LLL' }}
    if currentUser.isBoardAdmin
      a.js-delete(title="{{_ 'card-delete-notice'}}") {{_ 'delete'}}

template(name="setCardColorPopup")
  form.edit-label
    .palette-colors: each colors
      unless $eq color 'white'
        span.card-label.palette-color.js-palette-color(class="card-details-{{color}}")
          if(isSelected color)
            i.fa.fa-check
    button.primary.confirm.js-submit {{_ 'save'}}
    button.js-remove-color.negate.wide.right {{_ 'unset-color'}}

template(name="cardDeletePopup")
  p {{_ "card-delete-pop"}}
  unless archived
    p {{_ "card-delete-suggest-archive"}}
  button.js-confirm.negate.full(type="submit") {{_ 'delete'}}

template(name="deleteVotePopup")
  p {{_ "vote-delete-pop"}}
  button.js-confirm.negate.full(type="submit") {{_ 'delete'}}

template(name="cardStartVotingPopup")
  form.edit-vote-question
    .fields
      label(for="vote") {{_ 'vote-question'}}
      input.js-vote-field#vote(type="text" name="vote" value="{{getVoteQuestion}}" autofocus disabled="{{#if getVoteQuestion}}disabled{{/if}}")
      .check-div
        a.flex(class="{{#if getVoteQuestion}}is-disabled{{else}}js-toggle-vote-allow-non-members{{/if}}")
          .materialCheckBox#vote-allow-non-members(name="vote-allow-non-members" class="{{#if voteAllowNonBoardMembers}}is-checked{{/if}}")
          span {{_ 'allowNonBoardMembers'}}
      .check-div
        a.flex(class="{{#if getVoteQuestion}}is-disabled{{else}}js-toggle-vote-public{{/if}}")
          .materialCheckBox#vote-public(name="vote-public" class="{{#if votePublic}}is-checked{{/if}}")
          span {{_ 'vote-public'}}
      .check-div.flex
        i.fa.fa-hourglass-end
        a.js-end-date
          span
            | {{_ 'card-end'}}
            unless getVoteEnd
              i.iconkb.iconkb-plus
        if getVoteEnd
          +voteEndDate

    button.primary.js-submit {{_ 'save'}}
    if getVoteQuestion
      if currentUser.isBoardAdmin
        button.js-remove-vote.negate.wide.right {{_ 'delete'}}

template(name="positiveVoteMembersPopup")
  ul.pop-over-list.js-card-member-list
    each m in voteMemberPositive
      li.item
        a.name
          +userAvatar(userId=m._id)
          span.full-name
            = m.profile.fullname
            | (<span class="username">{{ m.username }}</span>)

template(name="negativeVoteMembersPopup")
  ul.pop-over-list.js-card-member-list
    each m in voteMemberNegative
      li.item
        a.name
          +userAvatar(userId=m._id)
          span.full-name
            = m.profile.fullname
            | (<span class="username">{{ m.username }}</span>)

template(name="deletePokerPopup")
  p {{_ "poker-delete-pop"}}
  button.js-confirm.negate.full(type="submit") {{_ 'delete'}}

template(name="cardStartPlanningPokerPopup")
  form.edit-poker-question
    .fields
      .check-div
        a.flex(class="{{#if getPokerQuestion}}is-disabled{{else}}js-toggle-poker-allow-non-members{{/if}}")
          .materialCheckBox#poker-allow-non-members(name="poker-allow-non-members" class="{{#if pokerAllowNonBoardMembers}}is-checked{{/if}}")
          span {{_ 'allowNonBoardMembers'}}
      .check-div.flex
        i.fa.fa-hourglass-end
        a.js-end-date
          span
            | {{_ 'card-end'}}
            unless getPokerEnd
              i.iconkb.iconkb-plus
        if getPokerEnd
          +pokerEndDate

    button.primary.js-submit {{_ 'save'}}
    if getPokerQuestion
      if currentUser.isBoardAdmin
        button.js-remove-poker.negate.wide.right {{_ 'delete'}}
